package com.openbravo.editor;

import com.openbravo.basic.BasicException;

public class JEditorPassword extends JEditorText
{
  private static final char ECHO_CHAR = '*';

  protected final int getMode()
  {
    return 0;
  }

  protected int getStartMode()
  {
    return 0;
  }

  protected String getTextEdit()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append("<html>");
    localStringBuffer.append(getEcho(this.m_svalue));
    if (this.m_cLastChar != 0)
    {
      localStringBuffer.append("<font color=\"#a0a0a0\">");
      localStringBuffer.append('*');
      localStringBuffer.append("</font>");
    }
    localStringBuffer.append("<font color=\"#a0a0a0\">_</font>");
    return localStringBuffer.toString();
  }

  public final String getPassword()
  {
    String str = getText();
    return str == null ? "" : str;
  }

  protected String getTextFormat()
    throws BasicException
  {
    return "<html>" + getEcho(this.m_svalue);
  }

  private String getEcho(String paramString)
  {
    if (paramString == null)
      return "";
    char[] arrayOfChar = new char[paramString.length()];
    for (int i = 0; i < paramString.length(); i++)
      arrayOfChar[i] = '*';
    return new String(arrayOfChar);
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.editor.JEditorPassword
 * JD-Core Version:    0.6.0
 */